// pages/detail/detail.js
Page({
  data:{

  },

  onLoad: function (options) {
    console.log(options.id)
    this.setData({
        mid : options.id
    })

    var that = this
    wx.request({
      url: "https://wx.dong.sowtai.com/test/" + options.id + ".json", //仅为示例，并非真实的接口地址

      success: function (res) {
        console.log(res)
        if(res.statusCode==200){
          that.setData({
            movie: res.data
          })

          wx.setNavigationBarTitle({
            title: res.data.rating.average + "分： " + res.data.title,
          })

          wx.hideNavigationBarLoading()
          }
      }
    })

    wx.showNavigationBarLoading()
  },
  onShareAppMessage: function () {
    return {
      title: "想你推荐：" + this.data.movie.title
    }
  }


})